class MyPage extends BaseEditWithTree {
    constructor(getTreeUrl, changeCatalogueUrl, fetchNodeUrl, saveNodeUrl, deleteNodeUrl, returnUrl) {
        super(getTreeUrl, changeCatalogueUrl, fetchNodeUrl, saveNodeUrl, deleteNodeUrl, returnUrl);
    }
}

var _Instance = null;

//-----------------------------------------------------------------------------
// 页面初始化
//-----------------------------------------------------------------------------
function onPageReady() {
    _Instance = new MyPage('/tech/piece_yardage/catalogue/tree.html',
            '/tech/piece_yardage/catalogue/changeParentCatalogue.html',
            '/tech/piece_yardage/catalogue/fetchByKey.html',
            '/tech/piece_yardage/catalogue/save.html',
            '/tech/piece_yardage/catalogue/delete.html',
            '/tech/piece_yardage_onesize/design/list.html?flag=1');

    _Instance.OnPageLoad();
}

// 画面大小或者位置移动
function onPageResize() {
    var h = $(window).height();
    var w = $(window).width();

    $("#treeArea").css({height: h - 110});
    $("#grid__wrapper").css({width: w - 8 - 275});
}

//-----------------------------------------------------------------------------
// 验证函数
//-----------------------------------------------------------------------------
$.validator.setDefaults({
    ignore: 'hidden, [reaonly=readonly]'
});
$.validator.addMethod("valueNotEquals", function (value, element, arg) {
    return arg !== value;
}, "Value must not equal arg.");

$(function () {
    $("#form_data").validate({
        // Step 1：设置验证规则和错误消息
        rules: {
            _OrderNo: "required",
            _CatalogueName: "required"
        },
        messages: {
            _OrderNo: "请填写目录编号。",
            _CatalogueName: "请填写目录。"
        },
        // Step 2：设置验证触发事件
        onclick: false,
        onfocusout: false,
        onfocusin: false,
        onkeyup: false,
        onkeydown: false,
        focusInvalid: false,
        // Step 3：设置错误信息提示
        showErrors: window.showErrors  //使用自定义的错误显示方法
    });
});